<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
		<link rel="stylesheet" type="text/css" href="/AddNewPic/AddNewPic.css"/>
	</head>
	<body>
		<script src="/javascripts/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
		<script src="//unpkg.com/vue/dist/vue.js"></script>
		<script src="//unpkg.com/element-ui/lib/index.js"></script>
		<script src="/AddNewPic/AddNewPic.js" type="text/javascript" charset="utf-8"></script>
		<div class="add_main">
			<div class="add_title">
				{{title_message}}
			</div>
		</div>
		<div class="form_box">
			<div id="app">
				<el-form ref="form" :model="form" label-width="80px" id="myform">
					<el-form-item label="标题" prop="title" :rules="[{ required: true, message: '标题不能为空'},{ maxlength: 100, message: '不能超出最大长度'}]">
						<el-input v-model="form.title" name="title" ></el-input>
					</el-form-item>
					<el-form-item label="链接" prop="subtitle" :rules="[{ required: true, message: '链接不能为空'},{ maxlength: 100, message: '不能超出最大长度'}]">
						<el-input v-model="form.subtitle" name="subtitle"></el-input>
					</el-form-item>
					
						<el-upload action="/upload" v-if="isnew==1" type="drag" :thumbnail-mode="true" :on-remove="handleRemove" :on-success="upload" :on-preview="handlePreview" accept="'image/pjpeg','image/jpeg','image/png','image/x-png'" :default-file-list="fileList">
							<i class="el-icon-upload"></i>
							<div class="el-dragger__text">将文件拖到此处，或<em>点击上传</em></div>
							<div class="el-upload__tip" slot="tip">只能上传jpg/png/jpeg/pjpeg文件，且不超过500kb</div>
						</el-upload>
						<el-upload  v-else action="/upload" type="drag" :multiple="false" :thumbnail-mode="true" :on-remove="handleRemove" :on-preview="handlePreview" :on-success="upload" accept="'image/pjpeg','image/jpeg','image/png','image/x-png'" >
							<i class="el-icon-upload"></i>
							<div class="el-dragger__text">将文件拖到此处，或<em>点击上传</em></div>
							<div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>
						</el-upload>
						<el-dialog v-model="Previewdata">
							<img v-bind:src="fileList[0].url"/>
						</el-dialog>
						<el-form-item label="">
							<el-input type="hidden" v-model="form.imgUrl" name="imgUrl" id="imgUrl"></el-input>
						</el-form-item>
					
					
					<el-form-item label="备注" prop="content" :rules="[{ required: true, message: '正文不能为空'},{ maxlength: 8000, message: '不能超出最大长度'}]">
						<el-input type="textarea" v-model="form.content" name="content" ></el-input>
					</el-form-item>
				</el-form>
				<div class="button">
					<el-button type="primary" id="confirm" @click="ConfirmForm('form')">确认</el-button>
					<el-button type="primary" id="cancle" @click="Cancle">取消</el-button>
				</div>
			</div>		
		</div>
	</body>
	
</html>
